import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
// 登录组件
const Login = () => import('../components/Login.vue')

// 通知组件
const Notices = () => import('../components/Notices.vue')
// 通知详情组件
const NoticeDetails = () => import('../components/NoticeDetails.vue')


// 学生组件
const Student = () => import('../components/student/Student.vue')
// 学生申报课题组件
const StudentSubjectDeclare = () => import('../components/student/StudentSubjectDeclare')
// 学生选择课题组件
const StudentSubjectChoose = () => import('../components/student/StudentSubjectChoose')
// 学生任务书详情组件
const StudentAssignmentView = () => import('../components/student/StudentAssignmentView')
// 学生填写提交开题报告组件
const StudentOpenReport = () => import('../components/student/StudentOpenReport') 
// 学生填写提交文献综述组件 
const StudentLiterature = () => import('../components/student/StudentLiterature') 
// 学生填写提交文献综述组件 
const StudentPaperOriginal = () => import('../components/student/StudentPaperOriginal') 
// 学生填写提交文献综述组件 
const StudentPaperFinal = () => import('../components/student/StudentPaperFinal') 
// 学生查询个人成绩组件 
const StudentScore = () => import('../components/student/StudentScore') 

// 教师组件
const Teacher = () => import('../components/teacher/Teacher')
// 教师选择指导学生组件 
const TeacherChooseStudent = () => import('../components/teacher/TeacherChooseStudent')
// 教师查看指导学生组件 
const TeacherViewStudents = () => import('../components/teacher/TeacherViewStudents')
// 教师申报课题组件
const TeacherSubjectDeclare = () => import('../components/teacher/TeacherSubjectDeclare')
// 教师任务书列表组件
const TeacherAssignmentList = () => import('../components/teacher/TeacherAssignmentList')
// 教师查看任务书详情组件
const TeacherAssignmentView = () => import('../components/teacher/TeacherAssignmentView')
// 教师任务书发布组件
const TeacherAssignmentPublish = () => import('../components/teacher/TeacherAssignmentPublish')
// 教师开题报告列表组件
const TeacherReportList = () => import('../components/teacher/TeacherReportList') 
// 教师审核开题报告组件
const TeacherReportReview = () => import('../components/teacher/TeacherReportReview')
// 教师文献综述列表组件 
const TeacherLiteratureReview = () => import('../components/teacher/TeacherLiteratureReview')
// 教师毕业论文(初稿)列表组件 
const TeacherPaperOriginalReview = () => import('../components/teacher/TeacherPaperOriginalReview')
// 教师毕业论文(终稿)列表组件 
const TeacherPaperFinalReview = () => import('../components/teacher/TeacherPaperFinalReview')
// 教师毕业论文(终稿)列表组件 
const TeacherStudentScore = () => import('../components/teacher/TeacherStudentScore')

// 学院领导组件 
const Leader = () => import('../components/leader/Leader')
// 学院领导审核课题组件
const LeaderCheckSubject = () => import('../components/leader/LeaderCheckSubject')
// 学院领导审核成绩组件
const LeaderCheckScore = () => import('../components/leader/LeaderCheckScore')
// 学院领导已审核课题组件
const LeaderCheckedSubject = () => import('../components/leader/LeaderCheckedSubject')
// 学院领导已审核成绩组件 
const LeaderCheckedScore = () => import('../components/leader/LeaderCheckedScore')
// 学院领导审核任务书组件
const LeaderCheckAssignment = () => import('../components/leader/LeaderCheckAssignment')
// 学院领导已审核任务书组件
const LeaderCheckedAssignment = () => import('../components/leader/LeaderCheckedAssignment')

// 管理员组件 
const Admin = () => import('../components/admin/Admin')
// 管理员通知组件
const AdminNotices = () => import('../components/admin/AdminNotices')
// 管理员编辑通知组件 
const AdminEditNotice = () => import('../components/admin/AdminEditNotice')
// 管理员添加通知组件 
const AdminAddNotice = () => import('../components/admin/AdminEditNotice')
// 管理员专业列表组件
const AdminDeptList = () => import('../components/admin/AdminDeptList')
// 管理员管理指定专业的教师组件
const AdminDeptTeacher = () => import('../components/admin/AdminDeptTeacher')
// 管理员管理指定专业的学生组件
const AdminDeptStudent = () => import('../components/admin/AdminDeptStudent')
// 管理员学院列表组件
const AdminCollegeList = () => import('../components/admin/AdminCollegeList')
// 管理员学院领导列表组件
const AdminCollegeLeader = () => import('../components/admin/AdminCollegeLeader')
// 管理员管理账号组件 
const AdminUser = () => import('../components/admin/AdminUser')
// 管理员毕设时间设置组件 
const AdminTimeDeptList = () => import('../components/admin/AdminTimeDeptList')

const routes = [
  { path: '/', component: Login },
  { path: '/login', component: Login },
  
  
  // 学生相关路由 
  { 
    path: '/students', 
    component: Student,
    children: [
      // { path: '/students/notices', component: StudentNotices } // 可以写全路径，
         // 不写全路径，则一定不能使用 / 打头
      { path: 'notices', component: Notices },
      { path: 'notices/:id', component: NoticeDetails},
      { path: 'declare', component: StudentSubjectDeclare},
      { path: 'choose', component: StudentSubjectChoose},
      { path: 'assignment', component: StudentAssignmentView}, // meta: {keepAlive: true}
      { path: 'open-report', component: StudentOpenReport},
      { path: 'literature', component: StudentLiterature},
      { path: 'paper-original', component: StudentPaperOriginal},
      { path: 'paper-final', component: StudentPaperFinal},
      { path: 'score', component: StudentScore}
    ]
  },
  // 教师相关路由
  {
    path: '/teacher', 
    component: Teacher,
    children: [
      { path: 'notices', component: Notices },
      { path: 'notices/:id', component: NoticeDetails},
      { path: 'choose', component: TeacherChooseStudent},
      { path: 'students', component: TeacherViewStudents},
      { path: 'declare', component: TeacherSubjectDeclare},
      { path: 'assignment', component: TeacherAssignmentList},
      { path: 'assignment/view/:id', component: TeacherAssignmentView},
      { path: 'assignment/publish/:id', component: TeacherAssignmentPublish},
      { path: 'open-report', component: TeacherReportList}, 
      { path: 'open-report/review/:id', component: TeacherReportReview},
      { path: 'literature', component: TeacherLiteratureReview},
      { path: 'paper-original', component: TeacherPaperOriginalReview},
      { path: 'paper-final', component: TeacherPaperFinalReview},
      { path: 'students/score', component: TeacherStudentScore} 
    ]
  },
  // 学院领导相关路由
  { 
    path: '/leader', 
    component: Leader,
    children: [
      { path: 'notices', component: Notices },
      { path: 'notices/:id', component: NoticeDetails},
      { path: 'check/subject', component: LeaderCheckSubject },
      { path: 'check/score', component: LeaderCheckScore},
      { path: 'checked/subject', component: LeaderCheckedSubject },
      { path: 'checked/score', component: LeaderCheckedScore}, 
      { path: 'check/assignment', component: LeaderCheckAssignment }, 
      { path: 'checked/assignment', component: LeaderCheckedAssignment }
    ]
  },
  // 管理员相关路由 
  {
    path: '/admin', 
    component: Admin,
    children: [
      { path: 'notices', component: AdminNotices },
      { path: 'notices/:id', component: NoticeDetails},
      { path: 'edit/notice/:id', component: AdminEditNotice},
      { path: 'add/notice', component: AdminAddNotice},
      { path: 'dept/teacher', component: AdminDeptList },
      { path: 'dept/student', component: AdminDeptList },
      { path: 'dept/:id/teacher', component: AdminDeptTeacher }, 
      { path: 'dept/:id/student', component: AdminDeptStudent },
      { path: 'college', component: AdminCollegeList },
      { path: 'college/:id/leader', component: AdminCollegeLeader },
      { path: 'user', component: AdminUser },
      { path: 'time', component: AdminTimeDeptList },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router

